﻿using System;
using System.Collections.Generic;
using System.Text;

using ShootSearch.Util;

using log4net;
using log4net.Appender;

using NUnit.Framework;

namespace ShootSearch.Tests.Logging
{
    [TestFixture]
    public class LogTest
    {
        [Test]
        public void SimpleTest()
        {
            log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(IO.StartupPath + "\\Logging\\log4net.xml"));
            ILog log = LogManager.GetLogger(typeof(LogTest));

            FireEventAppender.Instance.MessageLoggedEvent += new MessageLoggedEventHandler(Instance_MessageLoggedEvent);

            log.Debug("test log");

            log = LogManager.GetLogger("my type");
            log.Debug("test log 2");


        
        }

        void Instance_MessageLoggedEvent(object sender, MessageLoggedEventArgs e)
        {
            Console.WriteLine("Catch Message: " + e.LoggingEvent.RenderedMessage);
        }
    }
}
